# https://leetcode-cn.com/problems/min-cost-climbing-stairs/
# 746. 使用最小花费爬楼梯

from typing import List


class Solution:
    def minCostClimbingStairs(self, cost: List[int]) -> int:
        dp = [0] * (len(cost)+1)
        
        for i in range(2, len(cost)+1):
            dp[i] = min(dp[i-1] + cost[i-1], dp[i-2] + cost[i-2])

        print(dp)
        return dp[len(cost)]

a = Solution()
# a.minCostClimbingStairs([1, 100, 1, 1, 1, 100, 1, 1, 100, 1])
a.minCostClimbingStairs([10, 15, 20])